package cn.xuguowen.user.designPatten.chain_of_responsibility.article.common;

/**
 * ClassName: ArticleFilterEnum
 * Package: cn.xuguowen.user.designPatten.chain_of_responsibility.article.common
 * Description: 文章过滤器枚举类
 *
 * @Author 徐国文
 * @Create 2023/6/3 8:59
 * @Version 1.0
 */
public enum ArticleFilterEnum {

    WORD_COUNT(1,"字数过滤器");

    private Integer code;

    private String desc;

    ArticleFilterEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ArticleFilterEnum getByCode(int code) {
        for (ArticleFilterEnum value : ArticleFilterEnum.values()) {
            if (value.code == code) {
                return value;
            }
        }

        return null;
    }
}
